home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / rainbow.zip / RAINBOW.TXT
Text File  |  1996-07-09  |  1KB  |  46 lines

  1. The following module will put text in rainbow colours. Copy it into your html page and change the text and colours, or mail me and I'll do it for you.
  2. Peter Harman
  3. 100752.1770@compuserve.com
  4.  
  5. <HTML>
  6. <HEAD>
  7. <SCRIPT>
  8. <!--- Rainbow Text JavaScript module written by Peter Harman 1996
  9. //  100752.1770@compuserve.com
  10. var rainString = "Replace this text with that of your choice for it to appear in rainbow colours."
  11. var position = -1
  12. var longness = rainString.length - 1
  13. function rainbow(rainString) {
  14.    while(position <= longness) {  
  15.       document.write("<font color=\"#ff0000\">" + rainString.charAt(position) + "</font>")
  16.       position++
  17.       document.write("<font color=\"#ffa500\">" + rainString.charAt(position) + "</font>")
  18.       position++
  19.       document.write("<font color=\"#ffff00\">" + rainString.charAt(position) + "</font>")
  20.       position++
  21.       document.write("<font color=\"#008000\">" + rainString.charAt(position) + "</font>")
  22.       position++
  23.       document.write("<font color=\"#0000ff\">" + rainString.charAt(position) + "</font>")
  24.       position++
  25.       document.write("<font color=\"#4b0082\">" + rainString.charAt(position) + "</font>")
  26.       position++
  27.       document.write("<font color=\"#ee82ee\">" + rainString.charAt(position) + "</font>")
  28.       position++
  29. }
  30. }
  31. //-->
  32. </SCRIPT>
  33. </HEAD>
  34.  
  35. <BODY bgcolor="#000000">
  36.  
  37. <SCRIPT>
  38. <!--- Rainbow
  39. document.write(rainbow(rainString))
  40. // -->
  41. </SCRIPT>
  42.  
  43. </BODY>
  44.  
  45.  
  46.